<template>
  <el-container style="min-height: 100vh;">
    <!-- 侧边栏 -->
    <el-aside :width="sideWidth + 'px'" style="background-color: rgb(238, 241, 246);">
      <Aside :isCollapse="isCollapse"/>
    </el-aside>

    <el-container>
      <!-- 头部 -->
      <el-header style="border-bottom: 1px solid #ccc;">
        <Header :collapseBtnClass="collapseBtnClass" :collapse="collapse"/>
      </el-header >

      <!-- 表格区域 -->
      <el-main>
        <!-- 当前页面的子路由会在这里展示-->
        <router-view/>
      </el-main>

    </el-container>
  </el-container>
</template>

<script>

import Aside from "@/components/Aside";
import Header from "@/components/Header";
export default {
  name: 'Manage',
  components: {Header, Aside},
  data() {
    return {
      collapseBtnClass: 'el-icon-s-fold',
      isCollapse: false,
      sideWidth: 200
    }
  },
  methods: {
    collapse() {
      this.isCollapse = !this.isCollapse
      if(this.isCollapse) {
        this.sideWidth = 64
        this.collapseBtnClass = 'el-icon-s-unfold'
      } else {
        this.sideWidth = 200
        this.collapseBtnClass = 'el-icon-s-fold'
      }
    },
  }
}
</script>

<style>

</style>
